<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../Ajs/vue.js"></script>
</head>
<body>
<div id="box">
    <con-a></con-a>
    <con-b></con-b>
</div>

<script>
    /*
        局部组件只能在父组件中使用
    * */

    var conA = {
        data:function(){
            return {
                msg:"conA"
            };
        },
        template: "<div>{{msg}}<div>"
    };
    var conB = {
        data:function(){
            return {
                msg:"conB"
            };
        },
        template: "<div>{{msg}}<div>"
    };
    new Vue({
        el:"#box",
        data:{},
        components:{
            "con-a":conA,
            "con-b":conB,
        }
    })
</script>
</body>
</html>
